package com.liu.email;

import java.util.Vector;

/**
 * Mail的实体类
 *
 * @author liubo
 * @date 2020-01-21
 */
public class Mail {
    /**
     * 发件人
     */
    private String from = "";

    /**
     * 发件人密码
     */
    private String password = "";

    /**
     * 收件人
     */
    private String to = null;

    /**
     * 抄送收件人
     */
    private String cc = null;

    /**
     * 密送收件人
     */
    private String bcc = null;

    /**
     * smtp服务器地址
     */
    private String serverHost = "smtp.qq.com";

    /**
     * smtp服务器端口
     */
    private String serverPort = "26";

    /**
     * 附件文件名
     */
    protected String filename = "";

    /**
     * 邮件主题
     */
    protected String subject = "";

    /**
     * 邮件正文
     */
    protected String content = "";

    /**
     * SMTP服务器是否需要身份验证
     */
    private boolean needAuth = false;

    /**
     * 判断是否需要SSL验证
     */
    private boolean needSsl = true;

    /**
     * 用于保存发送附件的文件名的集合
     */
    protected Vector<String> file = new Vector<String>();

    /**
     * 超时时间（毫秒）
     */
    protected int timeout = 10000;

    /**
     *
     */
    private String charset = "utf8";

    /**
     * <br>
     * 方法说明:默认构造器 <br>
     * 输入参数: <br>
     * 返回类型:
     */
    public Mail() {
    }

    /**
     * <br>
     * 方法说明:构造器，提供直接的参数传入 <br>
     * 输入参数: <br>
     * 返回类型:
     */
    public Mail(String to, String from, String serverHost,
                String password, String subject, String content) {
        this.to = to;
        this.from = from;
        this.serverHost = serverHost;
        this.password = password;
        this.subject = subject;
        this.content = content;
    }

    /**
     * <br>
     * 方法说明:构造器，提供直接的参数传入_抄送+密送 <br>
     * 输入参数: <br>
     * 返回类型:
     */
    public Mail(String to, String cc, String bcc, String from, String serverHost,
                String password, String subject, String content) {
        this.to = to;
        this.cc = cc;
        this.bcc = bcc;
        this.from = from;
        this.serverHost = serverHost;
        this.password = password;
        this.subject = subject;
        this.content = content;
    }

    public String getFrom() {
        return from;
    }

    public void setFrom(String from) {
        this.from = from;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getTo() {
        return to;
    }

    public void setTo(String to) {
        this.to = to;
    }

    public String getCc() {
        return cc;
    }

    public void setCc(String cc) {
        this.cc = cc;
    }

    public String getBcc() {
        return bcc;
    }

    public void setBcc(String bcc) {
        this.bcc = bcc;
    }

    public String getServerHost() {
        return serverHost;
    }

    public void setServerHost(String serverHost) {
        this.serverHost = serverHost;
    }

    public String getServerPort() {
        return serverPort;
    }

    public void setServerPort(String serverPort) {
        this.serverPort = serverPort;
    }

    public String getFilename() {
        return filename;
    }

    public void setFilename(String filename) {
        this.filename = filename;
    }

    public String getSubject() {
        return subject;
    }

    public void setSubject(String subject) {
        this.subject = subject;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public boolean isNeedAuth() {
        return needAuth;
    }

    public void setNeedAuth(boolean needAuth) {
        this.needAuth = needAuth;
    }

    public boolean isNeedSsl() {
        return needSsl;
    }

    public void setNeedSsl(boolean needSsl) {
        this.needSsl = needSsl;
    }

    public Vector<String> getFile() {
        return file;
    }

    public void setFile(Vector<String> file) {
        this.file = file;
    }

    public int getTimeout() {
        return timeout;
    }

    public void setTimeout(int timeout) {
        this.timeout = timeout;
    }
}

